<template>
  <section>
    <div class="custorm--modelbox">
      <renohome-right-nav :custormItemData="custormItemData" :isPostor="true" @rightNavChange="rightNavChange"></renohome-right-nav>
      <section v-if="nrActive">
        <!-- <div class="edit-form-item">
          <div class="form-label">内容</div>
          <div class="stylebox flex-row flex-align-c"><span style="margin-right:13px;"></span>
            <el-input v-model="custormItemData.params.text" size="small">
            </el-input>
          </div>
        </div> -->

        <div class="edit-form-item">
          <div class="form-label">字号</div>
          <div class="stylebox flex-row flex-align-c"><span style="margin-right:13px;"></span>
            <el-input-number  style="width:100%;" :controls="false" v-model="custormItemData.style.font_size" size="small">
              <!-- <i slot="suffix" style="line-height: 32px;">
                {{custormItemData.params.subtext.length}}/8</i> -->
            </el-input-number>
          </div>
        </div>

        <div class="edit-form-item" v-if="custormItemData.style.display == '1'">
          <div class="form-label">颜色</div>
          <div class="stylebox flex-row flex-align-c ivu-color-picker"><span style="margin-right:13px;"></span>
            <el-color-picker class="ivu-input" v-model="custormItemData.style.color" size="mini"></el-color-picker>
            <span class="ivu-input">{{custormItemData.style.color}}</span>
          </div>
        </div>

        <div class="edit-form-item" v-if="custormItemData.style.display == '1'">
          <div class="form-label">居中方式</div>
          <el-radio-group v-model="custormItemData.style.center" @change="alignStyleChange($event, 'center')">
            <el-radio label="1">水平居中</el-radio>
            <el-radio label="2">垂直居中</el-radio>
          </el-radio-group>
          <el-button type="text" style="margin-left:20px;vertical-align: middle;" @click="alignStyleChange(custormItemData.style.center, 'center', true)">校验</el-button>
        </div>

        <div class="edit-form-item" v-if="custormItemData.style.display == '1'">
          <div class="form-label">对齐方式</div>
          <!-- custormItemData.style.pos_x = contentW - custormItemData.style.width -->
          <el-radio-group v-model="custormItemData.style.align" @change="alignStyleChange($event, 'align')">
            <el-radio label="1">左对齐</el-radio>
            <el-radio label="2">右对齐</el-radio>
          </el-radio-group>
          <el-button type="text" style="margin-left:20px;vertical-align: middle;" @click="alignStyleChange(custormItemData.style.align, 'align', true)">校验</el-button>
        </div>
      </section>
    </div>
  </section>
</template>

<script>
import defaultConfig from './utils/editConfig'
export default {
  mixins: [defaultConfig.mixins],
  props: {
    defaultConfig: {
      type: Object,
      default: function() {
        return defaultConfig
      }
    }
  },
  computed: {
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.custorm--modelbox{
  .es-form-item {
    border-bottom: 5px solid #f6f7f9;
    padding: 20px 23px;
    font-size: 12px;
  }

  .es-form-item .item-inner {
    margin-top: 8px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .es-form-item .item-inner:first-of-type {
    margin-top: 0;
  }

  .button-img {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    margin-right: 20px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 36px;
    text-align: center;
    border: 1px solid transparent;
  }

  .button-img.block {
    width: 100%;
    position: relative;
    min-height: 32px;
    height: auto;
    padding: 10px;
    text-align: left;
  }

  .es-title {
    margin: 12px;
    font-size: 16px;
  }

  .es-title .title-more {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title,
  .es-title.title2,
  .es-title.title12,
  .es-title.title13 {
    position: relative;
  }

  .button-img .es-title {
    margin: 0;
    line-height: 1.5;
  }

  .es-title.title1 .title,
  .es-title.title12 .title,
  .es-title.title13 .title {
    padding: 0 10px;
    position: relative;
    background: #fff;
    z-index: 2;
  }

  .es-title .sub-title {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title.title2 {
    .flex-row {
      align-items: baseline;
    }
    .sub-title {
      margin-left: 6px;
    }
  }

  .es-title.title3 {
    .main-title span {
      display: inline-block;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #ffd940;
      border: 1px solid transparent;
      position: relative;
      margin: 0 10px;
    }
    .main-title span::after {
      content: " ";
      position: absolute;
      top: -2px;
      left: -2px;
      width: 5px;
      height: 5px;
      border: 1px solid #333333;
      border-radius: 50%;
    }
  }

  .ivu-input-wrapper {
    display: inline-block;
    width: 100%;
    position: relative;
    vertical-align: middle;
    line-height: normal;
  }

  .readonly-div {
    position: relative;
    flex-grow: 1;
  }

  .readonly-div .readonly input {
    background: #e8effc;
    border: 0;
    padding-left: 18px;
    cursor: pointer;
    box-sizing: border-box;
    display: inline-block;
    width: 100%;
    height: 32px;
    line-height: 1.5;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
  }
}
</style>
